package com.lkd.service.impl;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lkd.domain.SkuClass;
import com.lkd.mapper.SkuClassMapper;
import com.lkd.pageParam.SkuPageParam;
import com.lkd.service.SkuClassService;
import org.springframework.stereotype.Service;

@Service
public class SkuClassServiceImpl extends ServiceImpl<SkuClassMapper, SkuClass> implements SkuClassService {
    @Override
    public Page<SkuClass> querySkuClassPage(SkuPageParam param) {
        Page<SkuClass> page = new Page<>();
        page.setSize(param.getPageSize());
        page.setPages(param.getPageIndex());
        QueryWrapper<SkuClass> wrapper = new QueryWrapper<>();
        wrapper.lambda().select(SkuClass::getClassId,SkuClass::getClassName,SkuClass::getParentId)
                        .eq(SkuClass::getClassName,param.getClassName());
        return page(page, wrapper);
    }
}
